home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / distri~1 / updates / incobj30.zoo / level30.zoo / usr / include / compiler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-30  |  4.3 KB  |  182 lines

  1. /* compiler specific defines */
  2. /* this file is guaranteed to be included exactly once if you include
  3.    anything at all. all site-dependent or compiler-dependent stuff
  4.    should go here!!!
  5.  */
  6.  
  7. #ifndef _COMPILER_H
  8. #define _COMPILER_H
  9.  
  10. /* symbol to identify the library itself */
  11. #ifndef __MINT__
  12. #define __MINT__
  13. #endif
  14.  
  15. /* symbols to identify the type of compiler */
  16. #ifdef __SOZOBONC__
  17. #define __SOZOBON__ __SOZOBONC__
  18. #else
  19. # ifdef SOZOBON
  20. # define __SOZOBON__ SOZOBON
  21. # endif
  22. #endif
  23.  
  24. #ifdef LATTICE
  25. #define __LATTICE__
  26. #endif
  27.  
  28. /* general library stuff */
  29. /* __SIZE_TYPEDEF__:     the type returned by sizeof() */
  30. /* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
  31. /* __WCHAR_TYPEDEF__:     wide character type (i.e. type of L'x') */
  32. /* __EXITING:           the type of a function that exits */
  33. /* __CDECL:             function must get parameters on stack */
  34.         /* if !__CDECL, passing in registers is OK */
  35.  
  36. /* symbols to report about compiler features */
  37. /* #define __NEED_VOID__    compiler doesn't have a void type */
  38. /* #define __MSHORT__        compiler uses 16 bit integers */
  39. /* (note that gcc and C68 define this automatically when appropriate) */
  40.  
  41. #ifdef __GNUC__
  42. #ifndef sun
  43. #  define __SIZE_TYPEDEF__ unsigned long
  44. #  define __PTRDIFF_TYPEDEF__ long
  45. #  define __WCHAR_TYPEDEF__ int
  46. #else
  47.    /* sun always seems to have an agenda of their own */
  48. #  include <sys/stdtypes.h>
  49. #  define __SIZE_TYPEDEF__ int          /* can you believe this!! */
  50. #  define __PTRDIFF_TYPEDEF__ int       /* or this!! */
  51. #  define __WCHAR_TYPEDEF__ unsigned short /* this seems reasonable */
  52. #  define _SIZE_T __SIZE_TYPEDEF__
  53. #  define _WCHAR_T __WCHAR_TYPEDEF__
  54. #endif
  55. #define __EXITING volatile void
  56. #ifndef __NO_INLINE__
  57. # define __GNUC_INLINE__
  58. #endif
  59. #endif
  60.  
  61. #ifdef __LATTICE__
  62. #define __SIZE_TYPEDEF__ unsigned long
  63. #define __PTRDIFF_TYPEDEF__ long
  64. #define __WCHAR_TYPEDEF__ char
  65. #define __EXITING void
  66. #ifdef _SHORTINT
  67. # define __MSHORT__
  68. #endif
  69. #endif
  70.  
  71. #ifdef __C68__
  72. #define __SIZE_TYPEDEF__ unsigned long
  73. #define __PTRDIFF_TYPEDEF__ long
  74. #define __WCHAR_TYPEDEF__ char
  75. #define __EXITING void
  76. #endif
  77.  
  78. #ifdef __SOZOBON__
  79. /*
  80.  * Temporary hacks to overcome 1.33i's short symbol names. Hopefully future
  81.  * versions will allow the extended Sozobon symbol format.
  82.  */
  83. #define _mallocChunkSize _sc_mCS
  84. #define _malloczero _sc_mz
  85. #define _console_read_byte _sc_crb
  86. #define _console_write_byte _sc_cwb
  87.  
  88. /* Doesn't know (void *) is special (but can handle it); this works better. */
  89. #define __NULL (0L)
  90. #ifdef OLD_SOZOBON
  91. #define void char
  92. #endif
  93. #define __SIZE_TYPEDEF__ unsigned int
  94. #define __PTRDIFF_TYPEDEF__ long
  95. #define __WCHAR_TYPEDEF__ char
  96. #define __EXITING void
  97. #define __MSHORT__
  98. #endif /* __SOZOBON__ */
  99.  
  100. #ifdef __TURBOC__
  101. #ifndef __STDC__
  102. #  define __STDC__ 1
  103. #endif
  104. #define __SIZE_TYPEDEF__ unsigned long
  105. #define __PTRDIFF_TYPEDEF__ long
  106. #define __WCHAR_TYPEDEF__ char
  107. #define __EXITING void
  108. #define __MSHORT__
  109. #define __VA_LIST__ void *
  110. #define __CDECL cdecl
  111. /* As long as we haven't ported gemlib to Pure C and hence have to use
  112.  * Turbo's/Pure's GEM library, define the next:
  113.  */
  114. #define __TCC_GEMLIB__
  115. #endif /* __TURBOC__ */
  116.  
  117. #if defined(__hpux) && (!defined(__GNUC__))
  118. #define __SIZE_TYPEDEF__ unsigned int
  119. #define __PTRDIFF_TYPEDEF__ int
  120. #define __WCHAR_TYPEDEF__ unsigned int
  121. #define __EXITING void
  122. #endif
  123.  
  124. /* some default declarations */
  125. /* if your compiler needs something
  126.  * different, define it above
  127.  */
  128. #ifndef __VA_LIST__
  129. #define __VA_LIST__ char *
  130. #endif
  131.  
  132. #ifndef __CDECL
  133. #define __CDECL
  134. #endif
  135.  
  136. #ifndef __NULL
  137. #  ifdef __MSHORT__
  138. #    define __NULL ((void *)0)
  139. #  else
  140.      /* avoid complaints about misuse of NULL :-) */
  141. #    define __NULL (0)
  142. #  endif
  143. #endif
  144.  
  145. #ifdef __cplusplus
  146. # define __EXTERN
  147. # define __PROTO(x) x
  148. #else
  149. # ifdef __STDC__
  150. #  ifndef __NO_PROTO__
  151. #    define __PROTO(x) x
  152. #  endif
  153. #  define __EXTERN
  154. # else
  155. #  define __EXTERN extern
  156. /*
  157.  * fudge non-ANSI compilers to be like ANSI
  158.  */
  159. #  define const
  160. #  define volatile
  161.  
  162. #  ifdef __NEED_VOID__
  163. typedef char void;    /* so that (void *) is the same as (char *) */
  164.     /* also lets us know that foo() {...} and void foo() {...} are
  165.        different */
  166. #  endif
  167. # endif /* __STDC__ */
  168. #endif /* __cplusplus */
  169.  
  170. #ifndef __PROTO
  171. #define __PROTO(x) ()
  172. #endif
  173.  
  174. /* macros for POSIX support */
  175. #ifndef __hpux
  176. #define _UID_T unsigned short
  177. #define _GID_T unsigned short
  178. #define _PID_T int
  179. #endif
  180.  
  181. #endif /* _COMPILER_H */
  182.